package park;

import java.util.List;

/**
 * @author 况祥彬
 * @date 2020/12/17 21:18
 **/
public class ParkGround<T> {
    private Integer parkCount;
    private Integer money;
    private List<T> trucks;

    public ParkGround(){};

    public ParkGround(List<T> trucks,Integer parkCount,Integer money){
        this.trucks=trucks;
        this.parkCount=parkCount;
        this.money=money;
    }

    public Integer getParkCount() {
        return parkCount;
    }

    public Integer getMoney() {
        return money;
    }

    public List<truck> getTrucks() {
        return trucks;
    }

    public void setParkCount(Integer parkCount) {
        this.parkCount = parkCount;
    }

    public void setMoney(Integer money) {
        this.money = money;
    }

    public void setTrucks(List<truck> trucks) {
        this.trucks = trucks;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ground ground = (ground) o;

        if (parkCount != null ? !parkCount.equals(ground.parkCount) : ground.parkCount != null) return false;
        if (money != null ? !money.equals(ground.money) : ground.money != null) return false;
        return trucks != null ? trucks.equals(ground.trucks) : ground.trucks == null;
    }

    @Override
    public int hashCode() {
        int result = parkCount != null ? parkCount.hashCode() : 0;
        result = 31 * result + (money != null ? money.hashCode() : 0);
        result = 31 * result + (trucks != null ? trucks.hashCode() : 0);
        return result;
    }
}
